window.onload = function(){
    for (var i = 0; i <= 8; i++) {
        for (var j = 8; j > i; j--) {
            document.write('&nbsp;&nbsp;&nbsp;');
        }
        for (var k = 0; k <= i; k++) {
            document.write(k + "&nbsp;");
        }
        for (var m = i - 1; m >= 0; m--) {
            document.write(m + "&nbsp;")
        }
        document.write("<br />")
    }
}